<?php
/**
 * @Author: jerry
 * @Date:   2015-03-13 10:07:31
 * @Last Modified by:   jerry
 * @Last Modified time: 2015-03-20 16:38:56
 */
namespace Admin\Model;
use Think\Model;
class MembersModel extends CommonModel {
	/**
	 * [validate 登陆验证]
	 * @return [type] [description]
	 */
		public function validates($username,$password){
			// return 1;
			$status = $this->where('username="'.$username.'"')->find();
			if($status){
				if($status['password'] ==md5($password)){
					return $status;
				}
			}else{
				return false;
			}


		}
		//protected $trueTableName = 'category'; 
		/**
		 * [findall 查找所有CATE]
		 * @return [type] [description]
		 */
		public function findall(){
			return $this->select();
		}
		 /**
		  * [insert 插入数据]
		  * @param  [type] $data [description]
		  * @return [type]       [description]
		  */
		 public function insert($data){

		 	return $this->add($data);
		 }

		  
		

}